package com.yuw.overridedemo2;

public class TestDriver {

	public static void main(String[] args) {
		test02() ;

	}
	
	private static void test02() {
		//多态
		//父类指代子类
		Animal animal=new Animal();
		//通过父类类型调用行为方法
		animal.doEating();
		System.out.println("===========");
		//向下溯型
		Cat cat0=(Cat)animal;
		cat0.doCatching();
	}

	
	private static void test01() {
		//多态
		//父类指代子类
		Animal animal=new Cat();
		//通过父类类型调用行为方法
		animal.doEating();
		System.out.println("===========");
		//向下溯型
		Cat cat0=(Cat)animal;
		cat0.doCatching();
	}

}
